/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui.admin.candidate;

import ui.*;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;

/**
 *
 * @author Administrator
 */
@ManagedBean
public class CandidateStatus {
    int value;
    String display;
    public CandidateStatus(){}

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    public CandidateStatus(int value, String display) {
        this.value = value;
        this.display = display;
    }
    
    /**
     * @return List<CourseStatus>
     * @see list of course status in a combobox
     */
    public List<CourseStatus> getAll(){
        List<CourseStatus> cs = new ArrayList<CourseStatus>();
        cs.add(new CourseStatus(1,"Activating"));
        cs.add(new CourseStatus(0,"Preparing"));
        cs.add(new CourseStatus(-1,"Removed"));
        return cs;
    }
    
    public String getDisplayName(int val){
        for (CourseStatus object : getAll()) {
            if (object.getValue() == val) {
                return object.getDisplay();
            }
        }
        return "error status";
    }
}
